/*
 * @Description: 异常
 * @Author: rendc
 * @Date: 2025-08-18 09:48:33
 * @LastEditors: rendc
 * @LastEditTime: 2025-08-18 10:27:32
 */

import java.util.Arrays;

public class Test {

  public static void main(String[] args) {
    int a = 10 / 5;
    int b = 10 / 3;
    double c = 10 / 3;
    System.out.println(a); // 2
    System.out.println(b); // 3
    System.out.println(c); // 3.0
    // int d = 10 / 0;
    // System.out.println(d);
    // String string = "123o";
    // int e1 = Integer.parseInt(string);
    // System.out.println("e1:" + e1);
    int e2 = Integer.parseInt("123");
    System.out.println("e2:" + e2);
    // Object o = new Object();
    Object o = new String("hello");
    // String string = new String();
    String string = (String) o;
    int[] arr = { 1, 2, 3 };
    System.out.println(arr);// ?
    System.out.println(Arrays.toString(arr));// ?
    // arr = null;
    System.out.println(arr);// ?
    System.out.println(Arrays.toString(arr));// ?
    // java.lang.NullPointerException
    System.out.println(arr[0]);
    // java.lang.NullPointerException
    // java.lang.ArrayIndexOutOfBoundsException
    // System.out.println(arr[4]);
    int c1;
    final int c2; // 常量
    c2 = 10;
    System.out.println(c2);
    // c2 = 1;
    // System.out.println(c2);
    // Student s1 = new Student();

    System.out.println("hello");
    test01();
    System.out.println("world");

  }

  public static void test01() {
    test02();
  }

  public static void test02() {
    test03();
  }

  public static void test03() {
    int a2 = 10 / 0;
  }
}